---@class UIBP_CardItem_C:UUserWidget
---@field Button_0 UButton
---@field Image_0 UImage
--Edit Below--
local UIBP_CardItem = { 
    
    CardType = 0;
}; 

--没调用

function UIBP_CardItem:Construct()
	print("UIBP_CardItem:Construct")
    self.Button_0.OnClicked:Add(self.Card_OnClicked,self)
    --self.Button_0.OnClicked:Add(self.Card_OnClicked,self)
end

function UIBP_CardItem:Card_OnClicked()
    print("UIBP_CardItem:Card_OnClicked")
    local PlayerController = GameplayStatics.GetPlayerController(UGCGameSystem.GameState, 0);
    if PlayerController ~= nil then
        local teamIndex = PlayerController.PlayerState.TeamIndex;
        if teamIndex ~= nil then
            -- 设置该用户选中的卡牌
            print("UIBP_CardItem:Card_OnClicked. teamIndex %d"..teamIndex)
            UGCGameSystem.GameState.PlayerInfos[teamIndex].CardChoosed = self.CardType;
            
        else
            print("UIBP_CardItem:Card_OnClicked get TeamIndex failed");
        end
    else
        print("UIBP_CardItem:Card_OnClicked get playerController failed");
    end
end
-- function UIBP_CardItem:Tick(MyGeometry, InDeltaTime)

-- end

-- function UIBP_CardItem:Destruct()

-- end

return UIBP_CardItem;